var SearchForm = function () {
  var template = /* html */ `
    <div class="search-form">
      <el-form inline label-width="auto" size="medium">
        <el-form-item label="异常类型">
          <el-select filterable clearable v-model="search.typeId" class="search-input">
            <el-option v-for="item in exceptionTypeData" :key="item.value" :value="item.value" :label="item.label">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="异常描述">
          <el-input v-model="search.exceptionType" class="search-input"></el-input>
        </el-form-item>
        <el-form-item label="解决人">
          <el-select filterable clearable v-model="search.solveUser" class="search-input">
            <el-option v-for="item in personList" :key="item.value" :value="item.value" :label="item.label">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="提出人">
          <el-select filterable clearable v-model="search.createUser" class="search-input">
            <el-option v-for="item in personList" :key="item.value" :value="item.value" :label="item.label">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="异常状态">
          <el-select clearable v-model="search.orderStatus" class="search-input">
            <el-option v-for="item in orderStatusList" :key="item.value" :value="item.value" :label="item.label">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
    </div>
  `;

  return {
    props: {
      search: {
        type: Object,
        required: true
      },
      exceptionTypeList: {
        type: Array,
        default: function () {
          return [];
        }
      },
      personList: {
        type: Array,
        default: function () {
          return [];
        }
      }
    },

    computed: {
      exceptionTypeData: function () {
        var exceptionTypeList = this.exceptionTypeList;
        exceptionTypeList = _.filter(exceptionTypeList, {
          status: 1
        });
        return exceptionTypeList
      }
    },

    data: function () {
      return {
        orderStatusList: i18n.getDropDown('productMgr.exceptionTable.orderStatus', [0, 1, 2, 3, 4, 5])
      };
    },

    template: template
  };
}();
